﻿/*
* SHARPUPNP
* 
* Written by Marco Minerva, mailto:marco.minerva@gmail.com
* 
* This code is released under the GNU General Public License (GPL) v2.
* A copy of this license is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace SharpUpnp
{
    /// <summary>
    /// Provides a set a properties that are common to all UPnP compliant device.
    /// </summary>
    public abstract class UpnpDevice
    {
        /// <summary>
        /// Gets the <see cref="System.Net.IPEndPoint"/> of the device.
        /// </summary>
        /// <value>The <see cref="System.Net.IPEndPoint"/> of the device.</value>
        /// <remarks>The <see cref="System.Net.IPEndPoint"/> class contains the host and local or remote port information needed by an application to connect to a service on a host. By combining the host's IP address and port number of a service, the <see cref="System.Net.IPEndPoint"/> class forms a connection point to a service.</remarks>
        public IPEndPoint EndPoint { get; internal set; }

        /// <summary>
        /// Gets a string that represents the service type of the device.
        /// </summary>
        /// <value>A string that represents the service type of the device.</value>
        /// <remarks>In case of NAT UPnP devices, this property can be <strong>urn:schemas-upnp-org:service:WANIPConnection:1</strong> or <strong>urn:schemas-upnp-org:service:WANPPPConnection:1</strong>.</remarks>
        public string ServiceType { get; internal set; }

        /// <summary>
        /// Gets the friendly name of the device.
        /// </summary>
        /// <value>The friendly name of the device.</value>
        public string Name { get; internal set; }

        /// <summary>
        /// Gets the Control URL of the device, i.e. the URL to which SOAP message requests for the device are sent.
        /// </summary>
        /// <value>The Control URL of the device.</value>
        /// <remarks>The Control URL is relative to the address of the device, as specified in the <see cref="EndPoint"/> property.</remarks>
        /// <seealso cref="EndPoint"/>
        public string ControlUrl { get; internal set; }

        /// <summary>
        /// Initializes a new <strong>UpnpDevice</strong>.object.
        /// </summary>
        /// <param name="endPoint">The <see cref="System.Net.IPEndPoint"/> of the device.</param>
        public UpnpDevice(IPEndPoint endPoint)
        {
            EndPoint = endPoint;
        }
    }
}
